# 1
def mkfile():
    filename = input('请输入文件名')
    file = open(filename, mode='w')

    notice = "请输入内容[单独输入':w保存退出']:"
    while 1:
        content = input(notice)
        if content != ':w':
            file.write(content + '\n')
            pass
        else:
            break
        notice = ''

    print('文件已保存')
    file.close()


# 2

def file_compare():
    file1 = open('openMe.txt')
    file2 = open('test1.txt')
    count = 0
    differ = []
    for line1 in file1:
        line2 = file2.readline()
        count += 1
        if line1 != line2:
            differ.append(count)
    file1.close()
    file2.close()
    return differ

differ = file_compare()

if len(differ) == 0 :
    print('文件一样')
else:
    print('两个文件共有[%d]处不同:' %len(differ))
    for each in differ:
        print('第 %d 行不一样' % each)


